function dialogbox(url,title,str,imgsrc,width,height,obj,event)
{
	var e = event || window.event;
	var width = width || "450px";
	if(!isNaN(width)) width = parseInt(width,10) + "px";
	var height = height || "320px";
	if(!isNaN(height)) height = parseInt(height,10) + "px";
	var bodyHeight = (parseInt(height,10) - 20) + "px";
	var title = title || "";
	var url = url || null;
	var str = str || null;
	var obj = obj || null;
	var imgsrc = imgsrc || "../images/coos/dialogclose.gif";
	var backDiv = document.createElement("div");
	backDiv.style.cssText = "position: absolute;width: 100%;height:100%;left: 0px;top: 0px;z-index: 10001;  background: #EEEEEE; filter:alpha(opacity=50); -moz-opacity:0.5;opacity: 0.5;display:;";
	backDiv.id = "dialogbox_backDiv";
	backDiv.innerHTML = '<iframe src="" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" style="position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:-1;"></iframe>';
	var shadowDiv = document.createElement("div");
	shadowDiv.style.cssText = "z-index: 10002;background: #000000; filter:alpha(opacity=20); -moz-opacity:0.2; opacity: 0.2;position: absolute; top: 0px;left: 0px; width: 100%; height: 100%;  display:;";
	shadowDiv.id = "dialogbox_shadowDiv";
	var boxDiv = document.createElement("div");
	boxDiv.style.cssText = "position:absolute;left:0px;top:0px;width:" + width + ";height:" + height + "; background-color:#FFFFFF; z-index:10003;display:none; border: #709cd2 1px solid;";
	boxDiv.id = "dialogbox_boxDiv";
	var boxTitle = '<div style="width:100%;height:20px;background: #739ED6;padding-top:4px;border-bottom: #cccccc 1px solid;"><span style="float:left;text-align:left;margin-left:5px;font-size:14px;color:#FFFFFF;font-weight:bold;width:auto;" id="dialogbox_boxDiv_title">' + title + '</span><span onclick="removeDialogbox()" style="float:right;width:30px;text-align:right;cursor:pointer;"><img src="'+ imgsrc + '" width="18" height="17"/>&nbsp;</span></div>';
	var boxbody_ifr = '<iframe id="dialogbox_Ifr" name="dialogbox_Ifr" src="javascript:void(0)" frameborder="0" scrolling="auto" height=' + bodyHeight + ' width="100%"></iframe>';
	var boxbody_div = '<div id="dialogbox_bodydiv" style="height:' + bodyHeight + 'width:100%;"></div>';
	boxDiv.innerHTML = boxTitle;
	this.displayBox = function(title)
	{
		if(title)
		{
			coos.$id("dialogbox_boxDiv_title").innerHTML = title;
		}
		if(coos.$id("dialogbox_backDiv") && coos.$id("dialogbox_backDiv") && coos.$id("dialogbox_shadowDiv"))
		{
			coos.$id("dialogbox_backDiv").style.display = "";
			coos.$id("dialogbox_boxDiv").style.display = "";
			coos.$id("dialogbox_shadowDiv").style.display = "";
			return ;
		}
	};
	this.removeBox = function()
	{
		document.body.removeChild(coos.$id("dialogbox_boxDiv"));
		document.body.removeChild(coos.$id("dialogbox_backDiv"));
		document.body.removeChild(coos.$id("dialogbox_shadowDiv"));
	};
	this.setTitle = function(sTitle)
	{
		if(coos.$id("dialogbox_boxDiv_title") && sTitle)
		{
			coos.$id("dialogbox_boxDiv_title").innerHTML = sTitle;
		}
	};
	this.createBox = function()
	{
		if(coos.$id("dialogbox_boxDiv"))
		{
			this.removeBox();
		}
		if(url)
		{
			boxDiv.innerHTML = boxTitle + boxbody_ifr;
			document.body.appendChild(boxDiv);
			if (url.indexOf ("?") > 0)
				url = url + "&random=" + new Date().getTime();
			else
				url = url + "?random=" + new Date().getTime();
			coos.$id("dialogbox_Ifr").src = url;
		}
		else if(str)
		{
			boxDiv.innerHTML = boxTitle + boxbody_div;
			document.body.appendChild(boxDiv);
			coos.$id("dialogbox_bodydiv").innerHTML = str;
		}
		else if(obj)
		{
			document.body.appendChild(boxDiv);
			boxDiv.appendChild(obj);
		}
		document.body.appendChild(backDiv);
		document.body.appendChild(shadowDiv);
		var obj_box = coos.$id("dialogbox_boxDiv");
		if(e)
		{
			obj_box.style.left = ((coos.window.width() - parseInt(obj_box.style.width,10))/2).toFixed() + "px";
			var objh = (parseInt(obj_box.style.height,10)/2).toFixed();
			var sh = parseInt(Math.max(document.body.scrollTop,document.documentElement.scrollTop),10);
			var wh = parseInt((coos.window.height()/2).toFixed(),10);
			var ch = sh + wh;
			obj_box.style.top  = (ch - objh) + "px";
		}
		else
		{
			obj_box.style.left = ((coos.window.width() - parseInt(obj_box.style.width,10))/2).toFixed() + "px";
			obj_box.style.top  = ((coos.window.height() - parseInt(obj_box.style.height,10))/2).toFixed() + "px";
		}
		var ds = coos.$id("dialogbox_shadowDiv");
		ds.style.width = (parseInt(obj_box.style.width,10) + 9) + "px";
		ds.style.height = (parseInt(obj_box.style.height,10) + 16) + "px";
		ds.style.left = (parseInt(obj_box.style.left,10) - 4) + "px";
		ds.style.top = (parseInt(obj_box.style.top,10) - 4) + "px";
		coos.$id("dialogbox_backDiv").style.width = document.body.scrollWidth + "px";
		coos.$id("dialogbox_backDiv").style.height = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight) + "px";
		this.displayBox(title);
	};
	this.createBox();
}
function removeDialogbox()
{
	if(coos.$id("dialogbox_boxDiv"))
	{
		document.body.removeChild(coos.$id("dialogbox_boxDiv"));
		document.body.removeChild(coos.$id("dialogbox_backDiv"));
		document.body.removeChild(coos.$id("dialogbox_shadowDiv"));
	}
}
